package com.example.mq;

import java.util.Date;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.outstanding.framework.base.mq.MQProducer;
import com.outstanding.framework.core.PendingException;

public class MqDemo {
	public static void main(String[] args) throws PendingException {
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
				"classpath*:**/spring/**/*Beans.xml");
		MQProducer bean = context.getBean(MQProducer.class);
		bean.sendMessage("topic1", "", new Object[] { "123", new MyMsg("456", new Date()) });
		bean.sendMessage("topic3", "", new Object[0]);

		try {
			Thread.sleep(10000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		context.close();
	}
}
